package com.wqmei.adapter;

import android.content.Context;
import android.os.Environment;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.wqmei.R;

import java.util.List;

/**
 * author: wqmei
 * date: 2018/4/23 17:34
 * description:
 */
public class LyricAdapter extends ArrayAdapter<String>
{
    private int resourceId;

    public LyricAdapter(@NonNull Context context, int resource, @NonNull List<String> objects)
    {

        super(context, resource, objects);
        resourceId = resource;
    }

    @NonNull
    @Override
    public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent)
    {
        String lyricStr = getItem(position);
        View view= LayoutInflater.from(getContext()).inflate(resourceId,null);
        TextView lyricItemTextView = view.findViewById(R.id.lyric_item_text);
        lyricItemTextView.setText(lyricStr);
        return view;
    }
}
